﻿<!DOCTYPE html>
<!--受限空间清单-->
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
        <script src="/static/js/common.js"></script>

    <script src="../../static/js/Resource/JobLicenseApp_wanglr.js"></script>
    <script src="../../static/js/Mock/JobLicenseApp_wanglr.js"></script>
    <link href="../../static/js/vue-treeselect/vue-treeselect.css" rel="stylesheet" />
    <script src="../../static/js/vue-treeselect/vue-treeselect.js"></script>
    <style>
        .el-dialog__body {
            height: 100% !important;
        }

        .el-dialog.is-fullscreen {
            overflow: hidden !important;
        }

        .vue-treeselect__control {
            height: 100%;
            border: none;
            background: none;
        }

        .vue-treeselect__placeholder {
            top: -3px;
        }

        .vue-treeselect__single-value {
            top: -3px;
        }
    </style>
</head>

<body>
    
<div id="app" v-cloak>   
        <el-row>
            <el-col>
                <el-form label-position="right" ref="form" :inline="true" :model="formInline" class="demo-form-inline"
                    style="margin-bottom: 15px;">
                    <el-row>
                        <el-col class="head-tool">
                            
<div class="new_title fl"><strong><img src="/static/images/icon1.png" />受限空间清单</strong>
                            </div>
                            <span>
                                <btn :text="col.btnSelect" imgsrc="/static/images/search.png" linetype="3"
                                    @click="onSubmit"></btn>
                                <btn :text="col.btnAdd" linetype="3" @click="UserInput('tj')"></btn>
                                <btn :text="col.btnDelete" linetype="4" @click="onDelete"></btn>
                            </span>
                        </el-col>
                    </el-row>
                    <el-row class="popupW50">
                        <el-col :xs="8" :sm="8" :md="8" :lg="6" :xl="6">
                            <div class="elst-select-mini">
                                <el-form-item>
                                    <el-input v-model="formInline.model.id" :placeholder="WireRopeAndHookCheck.CheckNo"
                                        size="mini">
                                        <template slot="prepend">
                                            {{WireRopeAndHookCheck.CheckNo+mark.m}}
                                        </template>
                                    </el-input>
                                </el-form-item>
                            </div>
                        </el-col>
                        <el-col :xs="8" :sm="8" :md="8" :lg="6" :xl="6">

                            <div class="elst-select-mini">
                                <el-form-item>
                                    <el-input size="mini">
                                        <template slot="prepend">
                                            {{ConfinedSpace.Editor+mark.m}}
                                        </template>
                                        <treeselect v-model="formInline.model.Editor" :options="Editor" :flat="true"
                                            :show-count="true" :disable-branch-nodes="true" slot="suffix"
                                            placeholder="请选择" style="line-height: 28px;width: 74%;float: right;" />
                                    </el-input>
                                </el-form-item>
                            </div>
                        </el-col>
                        <el-col :xs="8" :sm="8" :md="8" :lg="6" :xl="6">
                            <div class="elst-select-mini">
                                <el-form-item>
                                    <el-input size="mini">
                                        <template slot="prepend">
                                            {{ConfinedSpace.Auditor+mark.m}}
                                        </template>
                                        <treeselect v-model="formInline.model.Auditor" :options="Auditor" :flat="true"
                                            :show-count="true" :disable-branch-nodes="true" slot="suffix"
                                            placeholder="请选择" style="line-height: 28px;width: 74%;float: right;" />
                                    </el-input>
                                </el-form-item>
                            </div>
                        </el-col>
                        <el-col :xs="8" :sm="8" :md="8" :lg="6" :xl="6">
                            <div class="elst-select-mini">
                                <el-form-item>
                                    <el-input size="mini">
                                        <template slot="prepend">
                                            {{SafeOperationPlan.ApprovedBy+mark.m}}
                                        </template>
                                        <treeselect v-model="formInline.model.ApprovedBy" :options="ApprovedBy"
                                            :flat="true" :show-count="true" :disable-branch-nodes="true" slot="suffix"
                                            placeholder="请选择" style="line-height: 28px;width: 74%;float: right;" />
                                    </el-input>
                                </el-form-item>
                            </div>
                        </el-col>
                    </el-row>
                </el-form>


                <el-table ref="table" stripe :data="ListItem.tableData" :height="ListItem.tableHeight" border
                    @selection-change="handleSelectionChange" row-style="height:10px" style="width: 100%">
                    <el-table-column type="selection" align="center" width="55">
                    </el-table-column>
                    <el-table-column type="index" :label="JobLicenseManagement.SerialNumber" :index="indexMethod"
                        width="50" show-overflow-tooltip="true"></el-table-column>


                    <el-table-column prop="id" :label="WireRopeAndHookCheck.CheckNo" width="180">
                        <template slot-scope="scope">
                            {{scope.row.id}}
                        </template>
                    </el-table-column>
                    <el-table-column prop="Editor" :formatter="getDicValue" :label="ConfinedSpace.Editor">
                    </el-table-column>
                    <el-table-column prop="Auditor" :formatter="getDicValue" :label="ConfinedSpace.Auditor">
                    </el-table-column>
                    <el-table-column prop="ApprovedBy" :formatter="getDicValue" :label="SafeOperationPlan.ApprovedBy">
                    </el-table-column>
                    <el-table-column prop="Date" width="170" show-overflow-tooltip="true" :label="ConfinedSpace.Date">
                    </el-table-column>
                    <el-table-column width="53" prop="update" :label="col.btnUpdate" fixed="right" v-if="IsShow">
                        <template slot-scope="scope">
                            <button type="button" class="elst-bt-xg" @click=UserInput('xg',scope.row.id)>
                                <i class="el-icon-edit"></i>
                            </button>
                        </template>
                    </el-table-column>
                </el-table>
                <el-row type="flex" justify="end">


                    <el-pagination ref="page" @size-change="handleSizeChange" @current-change="handleCurrentChange"
                        :current-page="ListItem.currentPage" :page-sizes="ListItem.pagesizes"
                        :page-size="ListItem.pagesize" :layout="ListItem.layout" :total="ListItem.total">
                    </el-pagination>

                </el-row>
            </el-col>
        </el-row>
        <el-dialog title="受限空间填报" :visible.sync="ListItem.dialogVisible" @close='closeDialog' width="80%" height="80%"
            top="10vh" fullscreen="true">
            <iframe ref="iframe" :src="ListItem.InputUrl" style="height:95%;width:100%" frameborder="0"></iframe>
        </el-dialog>
    </div>
    <script type="text/javascript">
        Vue.component('treeselect', VueTreeselect.Treeselect)
        app = new Vue({
            el: '#app',
            data: function () {
                return {
                    //页面内左树
                    mydata: PersonInChargeTree,
                    defaultProps: {
                        children: 'children',
                        label: 'label'
                    },
                    //页面内数据初始化
                    ListItem: ListItem,
                    IsShow: true,
                    formInline: {
                        model: {
                            id: '',
                            Editor: null,
                            Auditor: null,
                            ApprovedBy: null,
                        },
                        offset: 0,
                        limit: 10
                    },
                    Editor: [],
                    Auditor: [],
                    ApprovedBy: []
                }
            },
            created: function () {

            },
            mounted: function () {
                this.Editor = fn(this.mydata, "0");
                this.Auditor = fn(this.mydata, "0");
                this.ApprovedBy = fn(this.mydata, "0");
                //初始化数据
                this.GetPageData(1);
                //列表高度自适应
                tablehigh(this);
                var type = getUrlParam("type");
                if (type && type == 'ck') {
                    this.IsShow = false;
                }
            },
            methods: {
                //解決edge下select bug
                visibleChange: function (isVisible) {
                    visibleChange(isVisible)
                },
                indexMethod: function (index) {
                    return (this.ListItem.currentPage - 1) * this.ListItem.pagesize + index + 1;
                },
                getDicValue: function (row, column, cellValue, index) {
                    return getTreeValue(this.mydata, cellValue);
                },
                closeDialog: function () { closeDialog(this); },
                //删除方法
                onDelete: function () { onDelete(this, '/api/ConfinedSpace/DeleteMuti'); },
                //列表选择触发
                handleSelectionChange: function (val) { handleSelectionChange(this, val); },
                //Dialog展示
                UserInput: function (val, id) { DialogShow(this, val, "ConfinedSpaceInput.html", id); },
                //获取分页数据
                GetPageData: function (currentIndex) { GetPageData(this, currentIndex, '/api/ConfinedSpace/GetList') },
                //查询方法
                onSubmit: function () { onSubmit(this); },
                //pagesize改变 触发方法
                handleSizeChange: function (val) { handleSizeChange(this, val); },
                //跳页触发方法
                handleCurrentChange: function (val) { handleCurrentChange(this, val); }
            }
        });

    </script>
</body>

</html>